package com.cyzy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cyzy.mapper.OptionsMapper;
import com.cyzy.service.OptionsService;
import com.cyzy.vo.QuestionOptions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OptionsServiceImpl extends ServiceImpl<OptionsMapper,QuestionOptions> implements OptionsService {

    @Autowired
    private OptionsMapper optionsMapper;

    // 根据题目ID获取所有选项
    public List<QuestionOptions> getOptionsByQuestionId(long questionId) {
        return optionsMapper.selectList(new QueryWrapper<QuestionOptions>().eq("question_id", questionId));
    }

}
